package com.medical.logback.response;

/**
 * @Auther:gzf
 * @Date : 2022/06/23
 */
public enum ResultCode {

    //1000系列通用错误
    SUCCESS(200, "操作成功"),
    WARNING(201, "操作失败"),
    ERROR_404(404, "error"),
    FAILED(1001, "接口错误"),
    VALIDATE_FAILED(1002, "参数校验失败"),
    PARAM_NULL(1003, "参数为空"),
    BIZ_ERROR(1004, "业务发生异常"),
    ERROR(500, "服务器内部错误"),

    //2000系列用户错误
    USER_NOT_EXIST(2000,"用户不存在"),
    USER_LOGIN_FAIL(2001,"用户名或密码错误"),
    USER_NOT_LOGIN(2002,"用户还未登录,请先登录"),
    NO_PERMISSION(2003,"权限不足,请联系管理员");

    private int code;
    private String msg;

    ResultCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
